package cn.harveychan.xuecheng.manage_cms.controller;

import cn.harveychan.xuecheng.api.cms.CmsPageControllerApi;
import cn.harveychan.xuecheng.framework.domain.cms.request.QueryPageRequest;
import cn.harveychan.xuecheng.framework.model.response.QueryResponseResult;
import cn.harveychan.xuecheng.manage_cms.service.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cms/page")
public class CmsPageController implements CmsPageControllerApi {

    @Autowired
    private PageService pageService;

    @Override
    @GetMapping("/list/{page}/{size}")
    public QueryResponseResult findList(@PathVariable("page") int page,@PathVariable("size") int size,
                                        QueryPageRequest queryPageRequest) {
        return pageService.findList(page, size, queryPageRequest);
    }
}
